#version 410 core

// Declare all the semantics
#define ATTR_POSITION	0
#define ATTR_NORMAL		1
#define ATTR_COLOR		2

#define VERT_POSITION	0
#define VERT_NORMAL		1
#define VERT_COLOR		2
#define VERT_INSTANCE	3

#define FRAG_COLOR		0

uniform mat4 Model;
uniform mat4 ModelViewProj;

layout(location = ATTR_POSITION) in vec3 Position;
layout(location = ATTR_NORMAL) in vec3 Normal;

layout(location = VERT_NORMAL) out vec3 vNormal;
layout(location = VERT_INSTANCE) out vec3 vPositionW;

void main()
{
	gl_Position = ModelViewProj * vec4(Position, 1.0f);
	vNormal = (Model * vec4(Normal, 0.0f)).xyz;
	vPositionW = (Model * vec4(Position, 1.0f)).xyz;
}
